package com.burgeon.backend.EnterpriseWeChat.controller;

import com.burgeon.backend.EnterpriseWeChat.service.EWSelfRaisService;
import com.burgeon.backend.SHOP.controller.BaseController;
import com.burgeon.backend.SHOPBACKEND.entity.OrderVO.OrderEntityItem;
import com.burgeon.backend.stsutil.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @author: 伯俊软件
 * @description: 线上自提
 * @date: 2021/7/5 14:27
 * @param
 * @return
 */
@RestController
@CrossOrigin
@RequestMapping("ew/selfRais")
public class EWSelfRaisController extends BaseController {

    @Autowired
    private EWSelfRaisService ewSelfRaisService;

    /**
     * @author: 伯俊软件
     * @description: 获取待取货订单
     * @date: 2021/7/5 15:41
     * @param token
     * @param store：店铺名称
     * @return com.burgeon.backend.stsutil.ResponseResult<java.util.List<com.burgeon.backend.SHOPBACKEND.entity.OrderVO.OrderEntityItem>>
     */
    @RequestMapping("showWaitingOrder")
    public ResponseResult<List<OrderEntityItem>> showWaitingOrder(String token, String store) throws Exception {
        List<OrderEntityItem> data = ewSelfRaisService.showWaitingOrder(token,store);
        return new ResponseResult<List<OrderEntityItem>>(SUCCESS,data);
    }

    /**
     * @author: 伯俊软件
     * @description: 已提货订单
     * @date: 2021/7/5 17:55
     * @param token
     * @param store
     * @return com.burgeon.backend.stsutil.ResponseResult<java.util.List<com.burgeon.backend.SHOPBACKEND.entity.OrderVO.OrderEntityItem>>
     */
    @RequestMapping("showMentionOrder")
    public ResponseResult<List<OrderEntityItem>> showMentionOrder(String token, String store) throws Exception {
        List<OrderEntityItem> data = ewSelfRaisService.showMentionOrder(token,store);
        return new ResponseResult<List<OrderEntityItem>>(SUCCESS,data);
    }


    /**
     * @author: 伯俊软件
     * @description: 订单详情
     * @date: 2021/7/6 14:12
     * @param token
     * @param XSNO：线上单号
     * @return com.burgeon.backend.stsutil.ResponseResult<com.burgeon.backend.SHOPBACKEND.entity.OrderVO.OrderEntityItem>
     */
    @RequestMapping("showOrderDetails")
    public ResponseResult<OrderEntityItem> showOrderDetails(String token, String XSNO) throws Exception {
        OrderEntityItem data = ewSelfRaisService.showOrderDetails(token,XSNO);
        return new ResponseResult<OrderEntityItem>(SUCCESS,data);
    }


}
